package com.rany.day06.demo02;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class SDFTest {
    public static void main(String[] args) throws ParseException {
        demo01();
        demo02();
    }

    private static void demo02() throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-mm-dd HH-MM-SS");
        Date parse = simpleDateFormat.parse("2023-05-22 17-06-00");
        System.out.println(parse);
    }

    private static void demo01() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-mm-dd HH-MM-SS");
        Date date =new Date();
        String format = simpleDateFormat.format(0L);
        String format1 = simpleDateFormat.format(date);
        System.out.println(format);
        System.out.println(format1);
    }


}
